package com.machuxin.dubbo.common;

import java.util.Iterator;
import java.util.ServiceLoader;

public class test {

    public static void main(String[] args) {
        ServiceLoader<SayHi> hi = ServiceLoader.load(SayHi.class);
        for (SayHi s : hi) {
            System.out.println(s.say());
        }
        Iterator<SayHi> iterator = hi.iterator();
        while (iterator.hasNext()){
            System.out.println(iterator.next().say());
        }

    }
}
